#ifndef VASH_JOB_HEADER
	#define VASH_JOB_HEADER
 	#include <set>
 	#include <string>
	#include <semaphore.h>
	#include <sys/types.h>

	class Job
	{
		public:
			Job(std::string line,std::string cwd = "./");
			std::string getCWD();
			std::string getCMD();
			std::string getARGS();
			void run(bool wait = true);
			void aquire();
			bool release();
		private:
			~Job();
			pid_t pid;
			std::string cwd;
			std::string cmd;
			std::string args;
			int iostreams[3][2];
			int ref_counter;
	};

	extern class JobManager
	{
		public:
			JobManager();
			int addJob(Job * job);
			int delJob(Job * job);
			Job * getJobFromID(int id);
			Job * getJobFromPID(int pid);
			~JobManager();
		private:
			std::set<Job*> jobs;
			sem_t job_sem;
	}JobMan;
#endif